import java.util.Scanner;

public class code3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = 0;
        int b = 0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (x>60) a++;
            if (x>85) b++;

        }
        System.out.printf("%.0f%%\n",1.0*a/n*100);//%%
        System.out.printf("%.0f%%\n",1.0*b/n*100);
    }
}
